#!/bin/sh

# radmind_wrapper: Run Radmind with post-apply scripts, etc.

. /private/etc/um-common.sh
. /private/etc/radmind.defaults

iHook_Output %BECOMEKEY
iHook_Output %WINDOWLEVEL HIGH
iHook_Output %UIMODE AUTOCRATIC
iHook_Output %TITLE The University of Michigan

# If Sophos Anti-Virus is running, kill it or fsdiff may never
# end.
for job in $(launchctl list | grep com.sophos | awk '{ print $NF }'); do
	launchctl unload "/Library/LaunchDaemons/${job}.plist"
done

echo "Radmind update beginning at $(date)"

# The actual Radmind hook.
/private/etc/hooks/run_radmind $*

echo "Radmind update completed at $(date)"

if test -f "${REBOOT_FLAG}"; then # A reboot is needed.
	reboot
fi
